<style scoped lang="scss">
    @import "@/styles/form.scss";
    @import "@/styles/button.scss";
</style>
<template>
    <div class="inputBox"
         :style="$attrs['style']"
    >
        <div class="label">
          <slot name="label" ></slot>
          <span  v-if="!($scopedSlots&&$scopedSlots.label)">{{$props.label}}</span>
          <i class="red"   v-if="$props.required" >*</i>
        </div>
        <div class="value" @click="()=>$emit('click')">
            <slot name="default"></slot>
            <span v-if="$props.value">
                        {{$props.value}}
            </span>
            <template v-else>
                <template v-if="$props.type==='select'">
                    <span>选择</span>
                    <svg-icon icon-class="right"
                              style="font-size: 14px;position:relative;top:0px;"></svg-icon>
                </template>
            </template>
        </div>
    </div>
    <van-divider v-if="$props.border" />
</template>
<script>
  export default {
    name: "inputBox",
    data() {
      return {};
    },
    props: {
      label: {
        type: [String, Number],
      },
      value: {
        type: [String, Number],
      },
      /**
       * @description: 类型
       * @params  1选中类型 select
       * 2文本类型 【默认】
       * @return
       */
      type: {
        type: [String, Number],
        default() {
          return '';
        },
      },
      emptyText: {
        type: [String, Number],
        default() {
          return '暂无';
        },
      },
      required: {
        type: [Boolean],
        default() {
          return false;
        },
      },
      border: {
        type: [Boolean],
        default() {
          return true;
        },
      },
    },
  };


</script>
